package io.hots.strategy;

import java.util.ArrayList;
import java.util.List;

/**
 * @author yueshibin@cetcbigdata.com
 * @date 2022/9/5 9:20 上午
 */
public class ShardingUserTableConfig {
    public static final List<String> tableFlagList = new ArrayList<>();

    static {
        tableFlagList.add("1");
        tableFlagList.add("2");
    }

    public static String getRandomTableFlag(String id){
        int hashCode = id.hashCode();

        int index = Math.abs(hashCode) % tableFlagList.size();

        return tableFlagList.get(index);
    }
}
